/** 社区帖子项 */
export interface CommunityItem {
  _id: string
  title: string
  desc?: string
  description?: string
  content?: string
  cover?: string
  aboutInfo?: {
    category: {
      _id: string
      name: string
      desc?: string
    }
  }
  category?: {
    _id: string
    name: string
    slug?: string
    color?: string
  }
  tags?: Array<{
    _id: string
    name: string
    color?: string
  }>
  author?: {
    _id: string
    nickname: string
    avatar?: string
    level?: number
    badge?: string
    signature?: string
    followers?: number
    posts?: number
  }
  authorID?: string
  categoryID?: string
  viewNum?: number
  views?: number
  likeNum?: number
  likes?: number
  commentNum?: number
  comments?: number
  favorites?: number
  shares?: number
  status?: number // 0: 草稿, 1: 已发布, 2: 已下架, 3: 审核中
  isTop?: boolean
  isHot?: boolean
  isRecommend?: boolean
  isOriginal?: boolean
  isPublish?: boolean
  isDelete?: boolean
  publishTime?: string
  createTime?: string
  createdAt?: string
  updateTime?: string
  updatedAt?: string
  isLiked?: boolean
  isFavorited?: boolean
  relatedPosts?: Array<{
    _id: string
    title: string
    cover?: string
    views: number
  }>
}

/** 评论回复项 */
export interface CommentReply {
  _id: string
  content: string
  author: {
    _id: string
    nickname: string
    avatar?: string
  }
  replyTo?: {
    _id: string
    nickname: string
  }
  likes: number
  isLiked?: boolean
  createdAt: string
}

/** 评论项 */
export interface CommentItem {
  _id: string
  nickname: string
  content: string
  time: string
  articleID: string
  address?: string
  createTime: string
  // 兼容字段
  author?: string
  avatar?: string
  likes?: number
  isLiked?: boolean
  replyCount?: number
  location?: string
  createdAt?: string
  replies?: CommentReply[]
}

/** 社区列表请求参数 */
export interface CommunityListParams {
  page: number
  pageSize: number
  category?: string
  keyword?: string
}

/** 社区详情请求参数 */
export interface CommunityDetailParams {
  id: string
}

